#ifndef __GlobalConfig__
#define __GlobalConfig__

#include "tchar.h"
#include <iostream>
#include <vector>
#include "..\client\errorcode.h"

using namespace std;

const int               KEY_LEN     = 32;
const int               USR_LEN     = 20;
const int               PWD_LEN     = 20;
const int               EML_LEN     = 32;
const int               DATALEN     = 1024;
const int               MIN_PWD_LEN = 6;
const string            DB_TYPE     = "SQLite";
const string            DB_NAME     = "server.db";
const string            SRV_LOG     = "server.log";
const string            CLT_LOG     = "client.log";
const string            DB_SCHEMA   = "DROP TABLE IF EXISTS user\n"
    "DROP TABLE IF EXISTS keys\n"
    "CREATE TABLE keys  (id INTEGER PRIMARY KEY AUTOINCREMENT, key  VARCHAR(32), gentime INTEGER, regtime INTEGER,        duration  INTEGER, state INTEGER, clienttype INTEGER)\n"
    "CREATE TABLE user  (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(32), pass VARCHAR(32),hardwareid VARCHAR(32), email VARCHAR(64), key INTEGER, FOREIGN KEY(key) REFERENCES keys(id))";


#endif